package com.bicntech.admin.controller.airport;

import com.bicntech.common.core.controller.SuperController;
import com.bicntech.common.core.domain.R;
import com.bicntech.system.dto.InfieldBasicDataDTO;
import com.bicntech.system.service.InfieldBasicDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RequestMapping("/infield-basic-data")
@RestController
@Slf4j
public class InfieldBasicDataController extends SuperController {

    @Resource
    private InfieldBasicDataService infieldBasicDataService;

    @GetMapping("/listNoPage")
    public R<List<InfieldBasicDataDTO>> listNoPage() {
        List<InfieldBasicDataDTO> infieldBasicDataList = infieldBasicDataService.listInfieldBasicData();
        return R.ok(infieldBasicDataList);
    }

    @GetMapping(value = "/queryById")
    public R<InfieldBasicDataDTO> queryById(@RequestParam(name = "id", required = true) Long id) {
        InfieldBasicDataDTO infieldBasicDataDTO = infieldBasicDataService.getInfieldBasicDataById(id);
        return R.ok(infieldBasicDataDTO);
    }


}

